/*
 * Order.java
 * Copyright (c) 2014, 2019, Kiri. 
 * All rights reserved.
 */
package com.onesalt.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.Transient;

/**
 * 订单
 *
 * @author kiri
 * @date 2015年4月19日
 * @version 1.0
 */
@Entity(name="t_order")
public class Order implements Serializable {

	private static final long serialVersionUID = -9163122379181595468L;

	public static final int STATUS_ORDERED = 1;
	public static final int STATUS_PAID = 2;
	public static final int STATUS_CANCELLED = 3;
	public static final int STATUS_REFUNDED = 4;
	
	@Id
	@GeneratedValue
	private Long orderId;
	
	private String sn;
	
	private int peopleNumber;
	
	private int price;
	
	private int amount;
	
	@Lob
	private String notes;
	
	private int status;
	
	private Date createTime = new Date();

	private String url;
	
	private Long dinerId;
	
	private Long cookId;
	
	private Long dinnerId;
	
	@Transient
	private User diner;

	@Transient
	private User cook;

	@Transient
	private Dinner dinner;
	
	@Transient
	private Payment payment;

	public Long getOrderId() {
		return orderId;
	}

	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}
	
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public User getDiner() {
		return diner;
	}

	public void setDiner(User diner) {
		this.diner = diner;
	}

	public Dinner getDinner() {
		return dinner;
	}

	public void setDinner(Dinner dinner) {
		this.dinner = dinner;
	}

	public Integer getPeopleNumber() {
		return peopleNumber;
	}

	public void setPeopleNumber(Integer peopleNumber) {
		this.peopleNumber = peopleNumber;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public User getCook() {
		return cook;
	}

	public void setCook(User cook) {
		this.cook = cook;
	}

	public Integer getPrice() {
		return price;
	}

	public void setPrice(Integer price) {
		this.price = price;
	}

	public Integer getAmount() {
		return amount;
	}

	public void setAmount(Integer amount) {
		this.amount = amount;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getDinerId() {
		return dinerId;
	}

	public void setDinerId(Long dinerId) {
		this.dinerId = dinerId;
	}

	public Long getCookId() {
		return cookId;
	}

	public void setCookId(Long cookId) {
		this.cookId = cookId;
	}

	public Long getDinnerId() {
		return dinnerId;
	}

	public void setDinnerId(Long dinnerId) {
		this.dinnerId = dinnerId;
	}

	public void setPeopleNumber(int peopleNumber) {
		this.peopleNumber = peopleNumber;
	}

	public void setPrice(int price) {
		this.price = price;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public Payment getPayment() {
		return payment;
	}

	public void setPayment(Payment payment) {
		this.payment = payment;
	}
}
